Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 4 - Geometric Operations / About Geometric Operations


Touching and Containing

QuickDraw GX allows you to determine if the area enclosed by the contours of one shape touch the area enclosed by the contours of another shape. You can also determine if one shape's area contains the area of another shape.

In particular, you can

Figure 4-12 shows the results of testing to see whether pairs of different geometric shapes touch. In this figure, a solid rectangle shape is tested for touching with both a framed path and a solid path, and a solid path is tested for touching with a solid polygon.

Figure 4-12 [Missing image]Testing whether one shape touches another

QuickDraw GX also allows you to determine whether or not

Figure 4-13 shows the results of testing pairs of shapes to see if one shape contains another.

Figure 4-13 Testing whether one shape contains another

Notice the first diagram in the third row of Figure 4-13. A shape does not contain another shape if it merely surrounds the other shape; the area covered by the first shape as drawn must contain the area of the second shape as drawn.

Note
QuickDraw GX defines empty shapes as touching no shapes and full shapes as touching any shape except an empty shape. QuickDraw GX also defines full shapes as containing any shape and empty shapes as being contained by any shape except other empty shapes.
For programming examples of testing shapes for intersection, see "Determining Whether Two Shapes Touch" beginning on page 4-53.

For programming examples of testing shapes for inclusion, see "Determining Whether One Shape Contains Another" beginning on page 4-58.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help